package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.huawei.appgallery.foundation.card.base.card.BaseDistCard;
import com.huawei.appgallery.foundation.card.gamereserve.bean.OrderAppCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appmarket.service.store.awk.bean.CombineOrderAppCardBean;
import java.util.ArrayList;
import java.util.List;
import o.cgz;
import o.chy;
import o.dof;
import o.dyf;
import o.ewm.j;

public class CombineOrderAppCard extends BaseDistCard {
    private ImageView ʻ;
    private TextView ʽ;
    private List<cgz> ˋ = new ArrayList();
    private dyf ॱॱ = new dyf();
    private chy ᐝ;

    public CombineOrderAppCard(Context context) {
        super(context);
    }

    public ArrayList<String> ˊ() {
        ArrayList<String> arrayList = new ArrayList();
        for (cgz o_cgz : this.ˋ) {
            View ˉ = o_cgz.ˉ();
            if (ˉ.getVisibility() == 0 && this.ॱॱ.ˎ(ˉ)) {
                CardBean ˌ = o_cgz.ˌ();
                if (ˌ instanceof BaseCardBean) {
                    arrayList.add(ˌ.ॱॱ() + "#$#" + ((BaseCardBean) ˌ).u_());
                }
            }
        }
        return arrayList;
    }

    public cgz ˏ(View view) {
        ˏ((TextView) view.findViewById(j.ʽˈ));
        ॱ((ImageView) view.findViewById(j.ʼꜞ));
        this.ʿ = (TextView) view.findViewById(j.ʼﾞ);
        ʽ(view);
        return this;
    }

    public cgz ˏ(int i) {
        if (i < 0 || i >= this.ˋ.size()) {
            return null;
        }
        return (cgz) this.ˋ.get(i);
    }

    public void ˏ(cgz o_cgz) {
        if (o_cgz != null && this.ˋ != null) {
            this.ˋ.add(o_cgz);
        }
    }

    public int ˎ() {
        return this.ˋ.size();
    }

    public void ˏ(CardBean cardBean) {
        int size;
        this.ˊᐝ = cardBean;
        CombineOrderAppCardBean combineOrderAppCardBean = (CombineOrderAppCardBean) cardBean;
        if (dof.ʽ(combineOrderAppCardBean.v_())) {
            this.ʿ.setVisibility(4);
        } else {
            this.ʿ.setVisibility(0);
            this.ʿ.setText(combineOrderAppCardBean.v_());
        }
        if (dof.ʽ(combineOrderAppCardBean.ॱॱ())) {
            ˋ().setVisibility(4);
            ॱॱ().setVisibility(4);
        } else {
            ˋ().setVisibility(0);
            ॱॱ().setVisibility(0);
        }
        if (combineOrderAppCardBean.ॱ() != null) {
            size = combineOrderAppCardBean.ॱ().size();
        } else {
            size = 0;
        }
        int ˎ = ˎ();
        for (int i = 0; i < ˎ; i++) {
            cgz ˏ = ˏ(i);
            if (ˏ instanceof OrderAppCard) {
                OrderAppCard orderAppCard = (OrderAppCard) ˏ;
                if (i >= size) {
                    orderAppCard.ˉ().setVisibility(8);
                } else {
                    orderAppCard.ˉ().setVisibility(0);
                    CardBean cardBean2 = (OrderAppCardBean) combineOrderAppCardBean.ॱ().get(i);
                    cardBean2.ˋˋ(combineOrderAppCardBean.ॱˉ());
                    orderAppCard.ˏ(cardBean2);
                }
            }
        }
    }

    public TextView ˋ() {
        return this.ʽ;
    }

    public void ˏ(TextView textView) {
        this.ʽ = textView;
    }

    public void ˏ(chy o_chy) {
        this.ᐝ = o_chy;
    }

    public ImageView ॱॱ() {
        return this.ʻ;
    }

    public void ॱ(ImageView imageView) {
        this.ʻ = imageView;
    }
}
